<%@ page language="java"
	import="java.util.*,edu.cnu.tpts.bean.*,edu.cnu.tpts.dao.*,edu.cnu.tpts.dao.impl.*"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/authorize.jsp"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



<html>
<head>
	<base href="<%=basePath%>">
    <title>admin</title>
    <link rel="stylesheet" type="text/css" href="/css/main.css">
 
</head>
<body>
<div id="header">

</div>
	<div id="menu">
			<ul>

				<li>
					<a hidefocus="hidefocus" href="admin/admin_tea.jsp">教师信息管理</a>
				</li>
				<li>
					<a hidefocus="hidefocus" href="admin/admin_stu.jsp">学生信息管理</a>
				</li>
				
				<li>
					<a hidefocus="hidefocus" href="quit.jsp">退出</a>
				</li>
				<%@include file="/WEB-INF/date.jsp"%>

			</ul>






		</div>

<div class="table">
    	<%
  	AdminDao adminDao = new AdminDaoImpl();
  	List <Teacher>teaList=adminDao.findAllTeacher();

  	TeacherDao teacherDao = new TeacherDaoImpl();
	
  	 %>
    <a href="teacher/register_tea.jsp">添加教师信息</a> <br>
  	  	<form action="admin/import.jsp">
  	  	  <table>
    	  	<tr>
    	  		<td> 使用excel导入教师数据</td>
    	  		<td> <input type="file" name="epath"></td>
    	  		<td><input type="submit" value="提交"></td>
    	  	</tr>
    	  </table>
    	  <input type="hidden" name="type" value="teacher">    	
    	  </form>
       
     	<table border="1px solid;">
    	<tr><td>教师编号</td><td>教师名称</td><td>登录名</td><td>性别</td><td>所在院系</td><td>教授课程</td><td>更新</td><td>删除</td></tr>
    	 <%for(Teacher teacher:teaList){ 
    	
    	%>
    	<tr>
    	<td><%=teacher.getId() %></td>
    	<td><%=teacher.getRealName() %></td>
    	<td><%=teacher.getLoginName() %></td>
    	<td><%=teacher.getSex() %></td>
    	<td><%=teacher.getTeaDepartment() %></td>
    	<td>
    	<%List<Course> courseList=teacherDao.getTeacheCourse(teacher); 
    	for(Course  course:courseList){
    	%>
    	<%=course.getName() %>,
    	<%} %>
    	</td>
    	<td><a href="teacher/updateTeacher.jsp?teaid=<%=teacher.getId() %>")>更新</a></td>
    	<td><a href="admin/doDelTea.jsp?teaid=<%=teacher.getId() %>")>删除</a></td>
    	</tr>
    	    	 	<%} %>
    	
    	
    	</table>
 

</div>

<div id="copyright">
    <div align="center">
        <font face="Tahoma, Verdana" color="#ffffff">Copyright &copy; 首都师范大学版权所有<br>

            地址：北京市西三环北路105号 100048&nbsp;&nbsp;&nbsp;&nbsp; E-mail: </font><font face="Tahoma, Verdana">

    </font>
    </div>

</div>

</body>
</html>